import React from "react";

type IProps={
    name?:string,
    sex:string,
    age:number
}

class MyPropsComponent extends React.Component<IProps> {
    constructor(props: IProps) {
        super(props);
    }

    render() {

        const{name,sex,age} = this.props;
        return (
            <>
                <ul>
                    <li>姓名:{name}</li>
                    <li>性别:{sex}</li>
                    <li>年龄:{age}</li>
                </ul>
            </>
        );
    }
}

export default MyPropsComponent